clc;
clear;
Files = dir(strcat('result/multiple/totinfo/','*.mat'));
LengthFiles = length(Files)
tmof = 0;
tmol = 0;
ttf = 0;
ttl = 0;
ttaf = 0;
ttal = 0;
tof = 0;
tol = 0;
first = zeros(LengthFiles,4);
last = zeros(LengthFiles,4);
for i = 1:LengthFiles;
    load(strcat('result/',Files(i).name));
    first(i,:) = [mof,tf,taf,of];
    last(i,:) = [mol,tl,tal,ol];
    tmof = tmof + mof;
    tmol = tmol + mol;
    ttf = ttf + tf;
    ttl = ttl + tl;
    ttaf = ttaf + taf;
    ttal = ttal + tal;
    tof = tof + of;
    tol = tol + ol;
end
tmof = tmof / LengthFiles
tmol = tmol / LengthFiles
ttf = ttf / LengthFiles
ttl = ttl / LengthFiles
ttaf = ttaf / LengthFiles
ttal = ttal / LengthFiles
tof = tof / LengthFiles
tol = tol / LengthFiles
save('totinfo.mat','first','last');